package top.rish.utils.excel;

import top.rish.utils.common.PingYinUtil;

/**
 *  这个类只是为了快速创建 成员属性
 */
public class TestExcelTable {

    private static final String n = "\n";
    public static void main(String[] args)   {

//       getAllFields("银行余额",new String[]{"记录时间","银行名称","银行账户","账号名称","币种","当前余额",
//               "可用余额","冻结金额","留存金额"});


//        getAllFields("票据明细",new String[]{"电子票据号码","出票金额","出票日期","汇票到期日","票据状态","持票人全称",
//                "持票人账号","承兑人名称","承兑人开户行行号","承兑人账号","保证人名称","出票人名称","出票人账号",
//                "前手名称","前手账户","背书日期","票据种类","背书转让标志","备注","票据文件路径","票据文件名称",
//                "传输流水号","图片文件名称"});

        getAllFields("回单明细",new String[]{"交易时间","银行名称","本方账户","账号名称","币种","借方发生额支取",
                "贷方发生额收入","对方名称","对方账号","对方开户行","摘要","备注","交易流水号",
                "回单文件路径","回单文件名称","回单编号","图片文件名称","明细主键","回单主键" });

//        getAllFields("交易明细",new String[]{"公司代码","利润中心","交易日期","交易时间","交易流水号","对方账号",
//                "对方户名","收款金额","付款金额","货币","本币金额","摘要","用途","结算号","结算方式",
//                "本方账号","本方户名","本方余额","主键"});
    }

    public static void getAllFields(String fileName,String[] array) {
        System.out.println(fileName);
        StringBuffer SB = new StringBuffer();
        for(int i = 0 ;i<array.length;i++){
            String name =  array[i];
            String spell = PingYinUtil.getFirstSpell(name);
            SB.append("            /**");
            SB.append(n);
            SB.append("            * ");
            SB.append(name);
            SB.append(n);
            SB.append("            */");
            SB.append(n);
            SB.append(  "            @ExcelCell(col = " );
            SB.append(i);
            SB.append(",");
            SB.append("descript=\"");
            SB.append(name);
            SB.append("\")");
            SB.append(n);
            SB.append( "            public String ");
            SB.append(spell);
            SB.append( ";");
            SB.append(n);
            SB.append(n);
        }
        System.out.println(SB);
        System.out.println("---------------------------------------------------------------------------------");
    }
}
